package com.oba.king.datalib;

import java.util.List;

import com.oba.base.dao.BaseDao;
import com.oba.base.interfaces.IHsqlBuilder;

public class RecieverInfoDao extends BaseDao{
	
	public IHsqlBuilder findAll() {
		return getSqlBuilder("from RecieverInfo r order by r.recieverName");
	}

	public IHsqlBuilder findByReciever(RecieverCondition recieverCondition) {
		IHsqlBuilder sql = getSqlBuilder("from RecieverInfo r");
		sql.add("r.recieverName like ?", recieverCondition.getRecieverName(), "%", "%");
		sql.add("r.customer = ?",recieverCondition.getCustomer());
		sql.addend("order by r.recieverName");
		return sql;

	}
	
	public List<Customer> findAllCustomer(){
		
		return find("from Customer c order by c.customerName");
		
	}

}
